﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SpringStudio.Common;
using Sdepci.InfoCode.BLL.CodeDesign;

namespace Sdepci.InfoCode.Web.CodeDesign
{
    public partial class TypeRuleSelector : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.BindData();
            }
        }

        /// <summary>
        /// 绑定数据列表
        /// </summary>
        private void BindData()
        {
            DataSet dsRule = new TypeRuleManager().GetTypeRuleDs();
            this.RuleGuid.DataSource = dsRule.Tables[0];
            this.RuleGuid.DataValueField = "RuleGuid";
            this.RuleGuid.DataTextField = "RuleName";
            this.RuleGuid.DataBind();
            this.RuleGuid.Items.Insert(0, new ListItem("=请选择编码类型=", ""));
            this.RuleGuid.Attributes.Add("onchange", "javascript:document.getElementById('btnConfirm').click();");
        }
    }
}
